<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>props</title>
</head>
<body>
    <div id="app">
        <child ref="c"></child>
        <child ref="cc"></child>
        <h1 ref="h">hhh</h1>
        <!-- <h1 id="t">标题1</h1> -->
        <!-- <h1 id="t1">标题1</h1> -->
    </div>

    <template id="temp1">
        <div>
            <p>{{msg}}</p>
           
        </div>
    </template>
</body>
<script src='../../vue文件/vue.js'></script>
<script>

    // document.querySelector("#t").style.color="red"
    Vue.component('child',{
       template:'#temp1' ,
       data(){
           return {
               msg:'son'
           }
       },
       methods:{
           a(){
               console.log('aaaa');
           }
       }
    });

    let vm = new Vue({
        el: '#app',
        data: {
             msg:'hello vue.js',
             
        },
        methods: {},
        mounted() {
            console.log(this.$refs);
            console.log(this.$refs.c);
            console.log(this.$refs.c.msg);
            console.log(this.$refs.c.a());
        },
    })
</script>
</html>